#include <bits/stdc++.h>
// 2025/01/24
// tag:
// Author: Zhang Muen
using namespace std;

int n, m, a[100001];
unordered_map<int, vector<int>> mp;
bool vis[100001];

void dfs(int x, int d)
{
    if (a[x])
        return;
    a[x] = d;
    for (int i = 0; i < mp[x].size(); i++)
        dfs(mp[x][i], d);
}

signed main()
{
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        int x, y;
        cin >> x >> y;
        mp[y].push_back(x);
    }
    for (int i = n; i >= 1; i--)
        dfs(i, i);
    for (int i = 1; i <= n; i++)
        cout << a[i] << ' ';
    return 0;
}